Bug 2046794 - Bugs cannot be updated if they contain a meta keyword after recent changes to show dependency tree inline#2645
Closed
dklawren wants to merge 2 commits into
Closed
Conversation
…fter recent changes to show dependency tree inline
There was a problem hiding this comment.
Pull request overview
Fixes a regression where editing/saving meta bugs can silently fail after embedding the dependency tree inside the bug edit form, due to an invalid “Max Depth” <input type="number"> when realdepth = 0 (no open dependencies).
Changes:
- Floors the dependency tree “Max Depth” input’s
maxand defaultvalueto1whenrealdepthis0. - Adds an inline template comment documenting the
checkValidity()failure mode when the tree is embedded in the bug change form.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cgsheeh
approved these changes
Jun 11, 2026
kyoshino
added a commit
to kyoshino/bmo
that referenced
this pull request
Jun 11, 2026
Handle Bug 2046794 / mozilla-bteam#2645
Collaborator
Author
|
Will be fixed instead by pr #2643 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause: PR #2636/#2637 embed the dependency tree directly into the bug page for meta bugs. The tree HTML is injected (extensions/BugModal/web/bug_modal.js → initDependencyTree) into #dependency-tree-container, which lives inside
(edit.html.tmpl lines 145–1463). That injected HTML includes a depth-control .The save handler in bug_modal.js:813 does:
if (hasInvalidField || !$form.checkValidity()) return;
checkValidity() validates every control in the form, including the injected number input. When a meta bug's tree has realdepth=0 — no open dependencies, which is now common because Bug 2046200 (commit fbaac11) made hide_resolved=1 the default for the embedded fetch — the input renders as min="1" max="0" value="0", which is invalid. So checkValidity() returns false and submit silently returns: no error, no network request. Exactly the reported symptom. Meta bugs that still have open dependencies (realdepth ≥ 1) submit fine, which is why it looked intermittent/meta-specific.
Fix: In template/en/default/bug/dependency-tree.html.tmpl, floor the input's max and value at 1 so the control always satisfies its own constraints, even when realdepth=0. No JS changes needed — the input element stays present (so disableControllers/updateControllers don't hit a null), and the depth toolbar is harmless/disabled on an empty tree anyway. The standalone tree page is unaffected (it has no surrounding validated form, and max=1 value=1 is more correct than the previous 0).
This is a one-template quick fix rather than a back-out, so the embedded dependency tree feature stays in place.